package com.xzj.spring.server;

import com.xzj.spring.annotation.Component;
import com.xzj.spring.process.BeanNameAware;
import com.xzj.spring.process.InitializingBean;

/**
 * @ProjectName: SpringDemo
 * @Package: com.xzj.impl
 * @ClassName: DServer
 * @Author: xzj
 * @Description:
 * @Date: 2022/7/11 20:31
 * @Version: 1.0
 */
@Component("dServer")
public class DServer implements BeanNameAware , InitializingBean {

    private String beanName;

    public DServer() {
        System.out.println("DServer");
    }

    @Override
    public void setBeanName(String beanName) {
        System.out.println("setName方法");
        this.beanName = beanName;
    }

    public void print(){
        System.out.println("beanName:" + beanName);
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("初始化方法");
    }
}
